home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 2
/
United Public Domain Gold 2.iso
/
utilities
/
pu023.dms
/
pu023.adf
/
TOOLS!
/
Xicon.Doc.Z
/
Xicon.Doc
Wrap
Text File
|
1988-07-08
|
17KB
|
307 lines
c
H
H H H H H 2H 3H 4H 5H H H H 5H 2H 3H 4H 15H 1H 1H 1H 1H 1H 1H 1H 0H 1H 20H 8H 8H 8H 8H 8H 8H 8H 8H 28H 0H 0H 0H 0H 0H 0H 0H 0H 40H 6H 6H 6H 6H 6H 6H 6H 42H 2H 2H 2H 2H 2H 2H 2H 2H 52H 4H 5H 6H 7H 8H 9H 59H 9H 0H 0H 9H 9H 9H 9H 9H
H H H H H H H H 3H 13H 2H 1H 0H 0H 1H 2H 3H 9H8H 9H 9H 9H 9H 9H 9H 9H 18H 6H 6H 6H 6H 6H 6H 6H 6H 26H 8H 8H 8H 8H 8H 8H 8H 8H 38H 4H 4H 4H 4H 4H 4H 4H 0H 0H 0H 0H 0H 0H 0H 0H 50H 57H 7H 7H 6H 5H 4H 4H 8H 7H 7H 7H
14H 16H 16H 16H 16H 16H 14H 25H 27H 27H 27H 27H 27H 25H
11H 13H 13H 13H 13H 13H 11H 22H 24H 24H 24H 24H 24H 22H
H H H H H H H H H 1H 1H 9H 9H 9H 9H 9H 9H 9H 9H
37H 37H 37H 37H 37H 37H 71H 71H 71H 71H
41H 43H 43H 43H 43H 43H 43H 42H43H 42H 41H 40H 40H 40H 40H 40H 40H 40H 40H
38H 38H 38H 41H 48H 48H 48H 47H 46H 45H 44H 42H 41H 40H 39H
39H 39H 39H 39H 39H 63H 63H 63H 63H 63H 63H44H 43H 42H 41H 42H
XICON -- Execute Command File from an Icon
(c) 1986, 1987 by Pete Goodeve -- All Rights Reserved
Permission is granted to distribute or modify these programs freely,
provided that no charge is made for their use, and that this notice
accompanies them. For commercial purposes, please contact the author:
Pete Goodeve
3012 Deakin Street #D
Berkeley, Calif. 94705
With this program you can execute a file of AmigaDOS CLI commands
directly from WorkBench, rather than using CLI, simply by double-clicking
an associated icon. A full-screen window is opened to display the output.
This is V2 of XICON, with many new features. You can now do such things as
specify window size (or run without any window), change window title, find
the directory the icon was invoked from, & specify command scripts besides
the one associated with the icon. You also get a Close Gadget on the window.
The text-display program TICON is now incorporated, with improvements.
The straightforward use of XICON is to have a 'project' icon associated
with a script file of CLI commands. When you double-click the icon, the
commands in the file will be executed. A full-screen window is opened to
display their output. The window will remain open when the script is
finished until you click on the Close gadget or type a control-C (or -D).
"Tool Types" can be added to the icon's info. For example, the window can
close automatically by setting the ToolType 'MODE=closewindow' in the icon.
If the commands have no output that you need to see, use "'MODE=nowindow'.
To set size, use the Tool Type 'WINDOW=...'. To change title, use 'TITLE='.
You also have the option of executing commands from the ToolTypes lines
of the icon itself, if you specify them with the 'CMD=...' ToolType.
You can specify additional command scripts (which will be executed before
the one associated with the icon) with 'SCRIPT=...'. You can include a
remark to be displayed in the window with 'REM=...', or a text file with
'TEXT=...'. You can include as many of THESE Tool Types as you like; they
are processed in sequence. The sequence may include a wait for a signal
from the user with 'PAUSE'.
The icon you click must always have a file associated with it, but this
needn't NECESSARILY be a list of CLI commands; if you set 'MODE=noscript',
it can be any type of data; you can operate on it if you want with commands
in the ToolTypes list. If you set 'MODE=text' it will be treated as a simple
text file to be displayed a page at a time in the window.
The Tool Type 'LOCDIR=..' lets you specify a file in a known DIR that will
be written with the complete pathname of the directory containing the icon.
A 'choice' mechanism has been added to this version. You can take special
action if the sequence has been aborted. See the description of the 'ABORT-'
Tool Types below. You can use the 'EXISTS=' Tool Type to see if a file
exists, and abort if it does not.
You can select more than one icon at a time, by holding down the SHIFT key
as you click on each. Only DOUBLE-click on the LAST selection (or use the
WorkBench menu "Open" item)
Text Display:
When XICON is in the text display mode ('MODE=text' or 'TEXT=...') the file
is displayed a window-full at a time. It will also pause if a form-feed
character is encountered. To continue, type any key or click in the bottom
window border. You can abort display by either clicking in the Close gadget'
or typing control-C; it will immediately proceed to the next operation if
any. You will have to repeat the action to exit XICON on the last operation.
This is different from the immediate exit that follows a click on the Close
gadget in response to a PAUSE Tool Type.
Setup:
You can install Xicon itself in any convenient directory on the same disk:
Whichever directory you use, the icons that are going to invoke it must
have a matching pathname as their DEFAULT TOOL (see below).
You can put an icon and its associated file in any "drawer" that you can
open under WorkBench. The file must have the same name as the icon (without
the '.info' extension). Each icon must be of type 'PROJECT' with a DEFAULT
TOOL string specifying a path to Xicon. If it is in the same directory,
'xicon' will suffice, otherwise you must use the complete pathname. A full
pathname always begins with "device name", which is either an actual device
(e.g. DF0:) or an assigned name (e.g. SYS:). If the icons are on the same
disk as xicon, the device can be simply ":" (Example- :XICON)
Command Scripts:
There are many ways to generate Command Script files with their icons.
One approach is to duplicate an existing icon, then go to the CLI and
modify the text file using your favorite text editor. If xicon is not in
the appropriate directory, you will have to change the Default Tool in the
icon to the correct pathname. Alternatively you can create the text file
first, then use CLI to copy a project icon and modify it as necessary.
Modifying an icon:
All the changes you NEED to make to an icon can be done with the 'Info'
item in the WorkBench Menu. Select the icon you want to modify by clicking
on it, press the right mouse button, & select 'Info' from the 'WorkBench'
menu. This brings up an information window for that icon.
To set the DEFAULT TOOL, click in that gadget and type in the string.
To enter a new TOOL TYPE, click first on the ADD gadget, then click in the
string gadget and type it in. If you want to insert it into an existing
set, use the arrow gadgets on the left to move to the desired point first.
Use the DEL gadget to remove a line completely.
When you are done, click in the SAVE box to preserve the changes. There is
a bug in WorkBench1.2: Tool Types you enter into the icon may get messed
up, causing the next string to be tagged on. The only fix seems to be
to go back to Info, re-edit all your Tool Types, and try saving again.
MODE Setting: You can alter Xicon's parameters by setting the ToolType: MODE
'MODE=closewindow' The window self-closes on completion of all commands.
'MODE=nowindow' No window is opened, all msgs are thrown away to "NIL:"
'MODE=noscript' prevents Xicon from trying to read commands from
its associated file. When the 'CMD=' Tool Type supplies the commands.
'MODE=text' Displays the associated file as text, a full window at a time.
Only one MODE entry will be recognized in the Tool Types array, so if you
want more than one of the above options, you must specify them separated
by the vertical-bar character, for example: 'MODE=noscript|closewindow'.
Modifying the Window:
You can specify the size, position and title of the window that XICON opens
by setting the Tool Type 'WINDOW=xxx/yyy/www/hhh/Title', where xxx and yyy
are the co-ordinates of the top left corner, www and hhh are width and
height, and Title is the desired name for the window. To change the TITLE
at ANY time in the sequence, use the ToolType 'TITLE=title string'. You can
use this more than once in a sequence
Commands in the Icon:
Instead of a script file, you can specify commands directly in the Icon Tool
Types array, with the 'CMD=Command string' format; Ex: 'CMD=list df1:work'
Include as many of these as you like. They will be executed in sequence,
but each by a separate CLI process, so you can't use a command to set
parameters like stack size or current directory for the ones that follow.
A Command Script file on the other hand is executed completely by one
process, so settings are inherited.
If you want to execute additional command script files BEFORE the one
associated with the icon (if any), use 'SCRIPT=filename'. 'filename' may
be the name of a script file in the same directory as the icon, or the
complete pathname of such a file. These may be interspersed with 'CMD=..'
lines, etc, & are executed sequentially. Each SCRIPT= is a separate process.
Finding the Directory:
An unfortunate problem of executing commands is that the new CLI has no idea
of which directory it was called from. To overcome this, XICON has the Tool
Type 'LOCDIR=filename'. If you include this in the icon, the specified file
will be created and filled with a text string giving the complete path name
of the directory containing the icon. Commands in the script can refer to
this file to take appropriate action. The string is always enclosed in
quotes, and has a newline character at the end. DOS commands such as CD
or DIR can read this string simply by redirecting their input and prompting
with '?' (for commands which don't need any output, you can suppress the
prompt by redirecting output to NIL:). For example, include in the icon info:
LOCDIR=RAM:my_icon_dir
then start your script with the sequence: CD <RAM:my_icon_dir >NIL: ?
and you are now working in the right directory. For neatness, you should
also delete the file before you end the command script. Choose unique file
names if you plan to be running more than one icon at a time.
Other Tool Types:
You have various other actions that you can request with Tool Type strings.
They may be intermixed with the previous types.
'TEXT=filename' displays the specified file in the window (like MODE=text)
'REM=text' displays the text line as a remark at that point.
'PAUSE' (No "="!) pauses the sequence at that point, Continue by clicking
in the bottom border of the window or typing any key. If you click in
the Close gadget, or type control-C, all remaining Tool Type commands
will be skipped except 'RESTORE', & those with the 'ABORT-' prefix.
'RESTORE' is only relevant if the sequence has been aborted. If encountered,
it removes the abort condition; Tool Type commands and the file
associated with the icon will be executed as normal.
'EXISTS=filename' will set the abort condition if the specified
file doesn't exist.
The 'abort' condition:
If the Close gadget is clicked or control-C typed in response to a PAUSE,
or if an 'EXISTS=...' Tool Type fails, the abort condition will be set;
all further normal Tool Type commands, and execution or display of the
file associated with the icon, are suppressed. If the 'RESTORE' Tool Type
is encountered, normal operation is restored.
There are a set of alternative Tool Type commands, corresponding to
the normal ones but prefixed with 'ABORT-', that will ONLY be executed
if the abort condition has been set:
ABORT-REM=...
ABORT-CMD=...
ABORT-TEXT=...
ABORT-SCRIPT=...
ABORT-PAUSE
Abort-Pause behaves JUST like normal PAUSE; if you click in the Continue
gadget or type a key other than control-C the abort condition is REMOVED.
Sequence of Tool Types:
Remember the difference between the Tool Types that control the environment
('MODE=...','WINDOW=...', etc.) and those that are scanned in sequence. The
first appearance of each of the former will be recognized at startup ONLY;
so they won't be affected by abort conditions. They may be placed anywhere
in the set of Tool Types, in any order, and they will still be recognized.
Tool Types processed at startup are:
MODE=
WINDOW=
LOCDIR=
Those processed in sequence are:
CMD=
REM=
SCRIPT=
TEXT=
TITLE=
PAUSE
RESTORE
EXISTS=
ABORT-...
If you misspell a Tool Type name, it will simply be ignored.
Caveats:
An annoying defect is that the "Execute()" system call used by xicon
loses track of the current directory when invoked by a WorkBench program
(it switches to DF0:). The LOCDIR Tool Type has been added to overcome this
problem, but if you don't use this you will have to specify full pathnames.
The "Execute" referred to above is NOT the DOS "EXECUTE" Command. Actually,
this system call (and therefore xicon) requires the DOS "RUN" command be in
the "C:" directory for its operation. Because xicon's method of calling
Execute() sets up the command file as the input stream, the output window
cannot be used as a console. So if a command needs keyboard input it must
open its own using I/O redirection, e.g.: mycommand <CON:0/100/150/50/input
You might also want to try "EXECUTE CON:0/100/150/50/exec"--or whatever you
have renamed that command as. (To get out of the mini-CLI you just created,
use 'control-\'.) If you really want to create a full new CLI, the best
method is 'NEWCLI FROM filename'
The initial stack size is always 4000 bytes. You can change this in your
command script with a STACK command. Note that the STACK gadget in the icon
Info window has no effect, except on XICON itself.
You cannot interrupt a command sequence with control-C or control-D,
although output can be paused with the space bar in the usual way. Don't
write a command file that can get "stuck" or you'll never close the window!
DOS won't let you use IF, SKIP, QUIT, etc, in these command files. Of course
you can use EXECUTE on a subsidiary script file, or 'NEWCLI FROM scriptfile'.
You can use the RUN command from a command script, of course, but any output
from the process started by RUN is thrown away instead of being displayed.
If you find these programs useful, please pass them around freely, and;
I would be pleased no end if you decided to send me $5 or $10. I'm also
glad to get comments -- positive OR negative.
OTHER SHAREWARE BY THE AUTHOR: ($25.)
Smart Input Line Interpreter "Sili(Con:)"
It lets you enter your commands with full cursor editing facilities.
Previous commands are kept in a VISIBLE history list; you can recall
commands for re-execution/re-editing, by using the arrow keys or clicking
on them. This occurs in its own window. You can enter & edit commands while
previous ones are running. If you have commands you are using repetively,
you can call them directly from the history window by double-clicking them.
You can push the command window out of the way, or bring it back with
one keystroke. Also, you can invoke command scripts without typing EXECUTE.
It is downloadable from several of the commercial services, and is also
on Fish disk #50. You can also order it directly, for $25 plus $3 p&p
(Calif. residents add 6.5% sales tax) from:
Winners Circle Systems
2618 Telegraph Avenue
Berkeley, California 94704
[Tel: (415) 845-4814]
CLICK CLOSE GADGET, OR USE CTRL-C OR CTRL-D TO EXIT